﻿<phone:PhoneApplicationPage xmlns:my="clr-namespace:Microsoft.Phone.Controls.Maps;assembly=Microsoft.Phone.Controls.Maps"  
							xmlns:toolkit="clr-namespace:Microsoft.Phone.Controls;assembly=Microsoft.Phone.Controls.Toolkit"
                            xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
                            xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
                            xmlns:phone="clr-namespace:Microsoft.Phone.Controls;assembly=Microsoft.Phone"
                            xmlns:shell="clr-namespace:Microsoft.Phone.Shell;assembly=Microsoft.Phone"
                            xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
                            xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
                            xmlns:controls="clr-namespace:Microsoft.Phone.Controls;assembly=Microsoft.Phone.Controls"
                            xmlns:System_Globalization="clr-namespace:System.Globalization;assembly=mscorlib"  xmlns:i="clr-namespace:System.Windows.Interactivity;assembly=System.Windows.Interactivity" xmlns:GalaSoft_MvvmLight_Command="clr-namespace:GalaSoft.MvvmLight.Command;assembly=GalaSoft.MvvmLight.Extras.WP71"  x:Class="CDFWPUG.Views.pageMeeting"
                            mc:Ignorable="d"
                            d:DesignWidth="480"
                            d:DesignHeight="696"
                            FontFamily="{StaticResource PhoneFontFamilyNormal}"
                            FontSize="{StaticResource PhoneFontSizeNormal}"
                            Foreground="{StaticResource PhoneForegroundBrush}"
                            SupportedOrientations="Portrait"
                            Orientation="Portrait"
                            shell:SystemTray.IsVisible="True"
                            DataContext="{Binding pageMeeting, Source={StaticResource Locator}}">

    <!--Sample code showing usage of ApplicationBar-->
    <phone:PhoneApplicationPage.ApplicationBar>
        <shell:ApplicationBar IsVisible="True" IsMenuEnabled="True" BackgroundColor="{StaticResource MyPhoneAccentColor}">
            <shell:ApplicationBarIconButton x:Name="btnPinToStart" 
                                            IconUri="/icons/appbar.pushpin.png" 
                                            Click="btnPinToStart_Click"
                                            Text="pin to start" />
        </shell:ApplicationBar>
    </phone:PhoneApplicationPage.ApplicationBar>

    <Grid x:Name="LayoutRoot"
          Background="{StaticResource MyPhoneBackgroundBrush}">
        <Grid.RowDefinitions>
            <RowDefinition Height="Auto" />
            <RowDefinition Height="*" />
        </Grid.RowDefinitions>

        <!--TitlePanel contains the name of the application and page title-->
        <StackPanel x:Name="TitlePanel"
                    Grid.Row="0"
                    Margin="12,17,0,28">
            <TextBlock x:Name="ApplicationTitle"
                       Text="NEXT MEETING"
                       Style="{StaticResource PhoneTextNormalStyle}" Foreground="{StaticResource MyPhoneForegroundBrush}" />
           
        </StackPanel>

        <!--ContentPanel - place additional content here-->
        <StackPanel  x:Name="ContentPanel" 
              Grid.Row="1"
              Margin="0,0,0,0" Width="480">
            <controls:Pivot Height="622" Foreground="{StaticResource MyPhoneForegroundBrush}">
                <controls:PivotItem Header="info" Width="480">
                    <StackPanel DataContext="{Binding Meeting}">
                        <TextBlock Text="{Binding Title}" Style="{StaticResource PhoneTextLargeStyle}" Foreground="{StaticResource MyPhoneForegroundBrush}" />
                        <TextBlock TextWrapping="Wrap" Text="{Binding Description}" Height="267" Style="{StaticResource PhoneTextBlockBase}" Foreground="{StaticResource MyPhoneForegroundBrush}" Margin="12,0" />
                        <TextBlock TextWrapping="Wrap" Text="{Binding Date}" Height="29" HorizontalAlignment="Right" Width="186" Style="{StaticResource MyPhoneTextAccentStyle}" />
                    </StackPanel>
                </controls:PivotItem>
                <controls:PivotItem Header="agenda">
                	<ListBox x:Name="lstAgenda"
                             DataContext="{Binding Meeting}"
                             ItemsSource="{Binding Agenda}"
                             ItemTemplate="{StaticResource AgendaListItem}" Foreground="{StaticResource MyPhoneForegroundBrush}"/>
                </controls:PivotItem>
                <controls:PivotItem Header="location" Margin="0">
                    
                    <Grid>
                        <Grid.RowDefinitions>
                            <RowDefinition Height="Auto" />
                            <RowDefinition Height="*" />
                        </Grid.RowDefinitions>
                        <Grid.ColumnDefinitions>
                            <ColumnDefinition  />
                            <ColumnDefinition  />
                        </Grid.ColumnDefinitions>

                        <my:Map LogoVisibility="Collapsed" ZoomLevel="15" 
                                x:Name="mapMeeting"
                                Center="{Binding Meeting.MeetingVenue.Location, Mode=OneWay}" 
                                Width="180" Height="180" Grid.Row="0" Grid.Column="0" CredentialsProvider="{Binding CredentialssProvider}" CopyrightVisibility="Collapsed" >
                            <my:Pushpin Location="{Binding Meeting.MeetingVenue.Location}" />
                        </my:Map>

                        <StackPanel  Grid.Row="0" Grid.Column="1">
                            <TextBlock Text="{Binding Meeting.MeetingVenue.Title}" 
                                       Style="{StaticResource PhoneTextExtraLargeStyle}" 
                                       Foreground="{StaticResource MyPhoneForegroundBrush}"  />
                            <TextBlock Text="{Binding Meeting.MeetingVenue.Address2}" 
                                       Foreground="{StaticResource MyPhoneForegroundBrush}"  />
                            <TextBlock Text="{Binding Meeting.MeetingVenue.Town}" 
                                       Style="{StaticResource PhoneTextSubtleStyle}" 
                                       Foreground="{StaticResource MyPhoneForegroundBrush}"  />
                            <TextBlock Text="{Binding Meeting.MeetingVenue.PostCode}" 
                                       Style="{StaticResource PhoneTextLargeStyle}" 
                                       Foreground="{StaticResource MyPhoneForegroundBrush}"  />
                            <TextBlock Text="{Binding Meeting.MeetingVenue.Address2}" 
                                       Foreground="{StaticResource MyPhoneForegroundBrush}"  />
                        </StackPanel>

                        <ListBox Grid.Row="1" Grid.ColumnSpan="2" x:Name="listLocation">
                        	<i:Interaction.Triggers>
                        		<i:EventTrigger EventName="SelectionChanged">
                        			<GalaSoft_MvvmLight_Command:EventToCommand Command="{Binding LocationTaskCommand}" PassEventArgsToCommand="True"/>
                        		</i:EventTrigger>
                        	</i:Interaction.Triggers>
                            <ListBoxItem x:Name="itemPhone" toolkit:TiltEffect.IsTiltEnabled="True">
                                <StackPanel>
                                    <TextBlock Foreground="{StaticResource MyPhoneForegroundBrush}" Style="{StaticResource PhoneTextExtraLargeStyle}"><Run Text="phone"/></TextBlock>
                                    <TextBlock Text="{Binding Meeting.MeetingVenue.Telephone}" Foreground="{StaticResource MyPhoneAccentBrush}" Style="{StaticResource PhoneTextAccentStyle}" />
                                </StackPanel>
                            </ListBoxItem>
                            <ListBoxItem x:Name="itemDirections" toolkit:TiltEffect.IsTiltEnabled="True">
                            	<StackPanel>
                            		<TextBlock Foreground="{StaticResource MyPhoneForegroundBrush}" Style="{StaticResource PhoneTextExtraLargeStyle}" Text="directions"/>
                            		<TextBlock Text="from here" Style="{StaticResource PhoneTextAccentStyle}" Foreground="{StaticResource MyPhoneAccentBrush}" />
                            	</StackPanel>
                            </ListBoxItem>
                            <ListBoxItem x:Name="itemWebsite" toolkit:TiltEffect.IsTiltEnabled="True">
                            	<StackPanel>
                            		<TextBlock Foreground="{StaticResource MyPhoneForegroundBrush}" Style="{StaticResource PhoneTextExtraLargeStyle}" Text="website"/>
                                    <TextBlock Text="{Binding Meeting.MeetingVenue.Website}" Foreground="{StaticResource MyPhoneAccentBrush}" Style="{StaticResource PhoneTextAccentStyle}" />
                            	</StackPanel>
                            </ListBoxItem>
                        </ListBox>


                    </Grid>
                    
                    
                 
                </controls:PivotItem>
                <controls:PivotItem Header="options">
                    <StackPanel>
                        <toolkit:ToggleSwitch 
                                Name="chkReminder" 
                                Header="Reminder" 
                                Content="off" 
                                Checked="chkReminder_Checked"
                                Width="450"
                                Unchecked="chkReminder_Unchecked" Foreground="{StaticResource MyPhoneForegroundBrush}" SwitchForeground="{StaticResource MyPhoneAccentBrush}" Background="{StaticResource MyPhoneBackgroundBrush}" BorderBrush="{StaticResource MyPhoneBorderBrush}" IsChecked="{Binding IsReminderSet, Mode=TwoWay}">

                            <toolkit:ToggleSwitch.HeaderTemplate>
                                <DataTemplate>
                                    <ContentControl Content="{Binding}" Foreground="{StaticResource MyPhoneAccentBrush}"  />
                                </DataTemplate>
                            </toolkit:ToggleSwitch.HeaderTemplate>
                        </toolkit:ToggleSwitch>
                    </StackPanel>
                </controls:PivotItem>
            </controls:Pivot>
        </StackPanel>
    </Grid>

</phone:PhoneApplicationPage>